import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/**
 * 路由管理
 */
const routes = [
  {
    path: '/',
    redirect: '/pages/dashboard'
  },
  {
    path: '/pages/dashboard',
    component: () => import('../pages/dashboard/index'),
    meta: {
      title: '首页'
    }
  },
  {
    path: '/pages/error',
    component: () => import('../pages/error/index'),
    meta: {
      title: '报错页'
    }
  }
]

const router = new VueRouter({
  base: process.env.BASE_URL,
  routes
})

export default router